/*
 * @Author: zxc
 * @Date: 2020-11-11 14:23:35
 * @LastEditTime: 2020-11-11 14:37:46
 * @LastEditors: zxc
 * @Description:盛最多水的容器
 */
/**
 * @param {number[]} height
 * @return {number}
 */
var maxArea = function (height) {
  const len = height.length
  let left = 0,
    right = len - 1,
    max = 0
  while (left < right) {
    let temp =
      (right - left) *
      (height[left] < height[right] ? height[left++] : height[right--])
    if (temp > max) max = temp
  }
  return max
}
